package downpacket

import "gitee.com/yanwc/ebike-xiaoan-device/internal/field"

type UpgradeReq struct {
	Url string `json:"url"`
	Crc int    `json:"crc"`
}

type UpgradeSafeReq struct {
	SUrl string `json:"surl"`
	SCrc int    `json:"scrc"`
}

func NewUpgradeReq[T UpgradeReq | UpgradeSafeReq](msgNo field.SerialNumber, req T) *Req[T] {
	return &Req[T]{
		CmdWord: RemoteUpgradeCommandWord,
		MsgNo:   msgNo,
		Param:   req,
	}
}
